package com.controller;

import com.service.EsInitService;
import com.service.MqInitService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static core.Constants.Es.INDEX_NAME;

@RestController
@RequestMapping("/init")
public class InitController {
    private EsInitService esInitService;
    private MqInitService mqInitService;

    public InitController(EsInitService esInitService, MqInitService mqInitService) {
        this.esInitService = esInitService;
        this.mqInitService = mqInitService;
    }

    @RequestMapping("/es")
    public void esInit() {
        esInitService.init(INDEX_NAME);
    }

    @RequestMapping("/mq")
    public void mqInit() {
        mqInitService.init();
    }

}
